<?php 
include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/header.php');
$id=$_GET['id'];
$sum=3;
$p=isset($_GET['p'])&&!empty($_GET['p'])?$_GET['p']:1;
$off=($p-1)*3; 
$res=sel($config,'article',"where cid={$id} limit {$off},{$sum}");
$res_cate=sel($config,'category',"where id=$id");

 ?>
<div class="banner">
  <section class="box">
  
    <div class="avatar"><a href="#"><span>杨青</span></a> </div>
  </section>
</div>
<div class="template">
 
</div>
<article>
  
  <div class="bloglist left">

<?php 
foreach ($res as $v) {
echo '<h3>'.$v['title'].'</h3>
<figure><img src="'.$v['pic'].'"></figure>
<ul>
      <p>'.mb_substr(strip_tags($v['content']),0,21).'</p>
      <a href="/home/articlede.php?id='.$v['id'].'" target="_blank" class="readmore">阅读全文>></a>
    </ul>
 <p class="dateview"><span>发布时间:'.date('Y-m-d H:i:s',$v['time']).'</span><span>作者：'.$v['uid'].'</span><span>分类：'.$res_cate[0]['name'].'</span></p>
';
}
 ?>   

    <div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare"><a class="bds_tsina"></a><a class="bds_qzone"></a><a class="bds_tqq"></a><a class="bds_renren"></a><span class="bds_more"></span><a class="shareCount"></a></div>
    <script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=6574585" ></script> 
    <script type="text/javascript" id="bdshell_js"></script> 
    <script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script> 
    <!-- Baidu Button END -->   
    <a href="/" class="weixin"> </a></aside>
</article>








<?php include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/footer.php'); ?>